import java.net.*;
import java.io.*;

public class Main
{
	public static void main(String args[])
	{
		InetAddress inetAddress = null;
		InetAddress tab[] = null;
		try{
			inetAddress = InetAddress.getLocalHost();
		}
		catch(UnknownHostException e){
		System.out.println("Nie mona uzyska adresu IP dla tego komputera.");
			System.exit(0);
		}
		String localName = inetAddress.getHostName();
		try{
			tab = InetAddress.getAllByName(localName);
		}
		catch(UnknownHostException e){
		System.out.println("Nie mona uzyska adresu IP dla tego komputera.");
			System.exit(0);
		}
		for (int i = 0; i < tab.length; i++){
			String ip = tab[i].getHostAddress();
			System.out.println("IP[" + i + "] = " + ip);
		}
	}
}
